<%= form_for(@stock) do |f| %>
  <% if @stock.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@stock.errors.count, "error") %> prohibited tdis stock from being saved</h2>

      <ul>
        <% @stock.errors.full_messages.each do |msg| %>
          <li><%= msg %></li>
        <% end %>
      </ul>
    </div>
  <% end %>


  <table>
    <tr>
      <td> <div>Name:</div> </td>
      <td> <div class="field"> <%= f.text_field :name %></div> </td>

      <td> <div>Company:</div> </td>
      <td> <div class="field"> <%= f.text_field :company %> </div> </td>

      <td>   <div>Purchase Qty.:</div> </td>
      <td>  <div class="field"> <%= f.text_field :purchase_quantity%></div> </td>

      <td>   <div>Purchase Date:</div> </td>
      <td>  <div class="field"> <%= f.text_field :purchase_date%></div> </td>
    </tr>

    <tr>
      <td> <div>Free Qty.:</div> </td>
      <td> <div class="field"> <%= f.text_field :free_quantity %></div> </td>

      <td> <div>Total Purchase Cost:</div> </td>
      <td> <div class="field">  <%= f.text_field :total_purchase_cost %></div> </td>

      <td>  <div>Sale Cost:</div> </td>
      <td>  <div class="field">     <%= f.text_field :sale_cost %></div> </td>
    </tr>

    <tr>
      <td>  <div>Tax % :</div> </td>
      <td>  <div class="field">     <%= f.text_field :tax_percentage %></div> </td>

      <td>  <div>Commission % :</div> </td>
      <td>  <div class="field">     <%= f.text_field :commission_percentage%></div> </td>

      <td> <div>Seller:</div> </td>
      <td> <div class="field"> <%= f.select(:person_id,Person.sellers.collect {|p| [ p.name, p.id ] }, {:include_blank => true}) %></div> </td>
      <td> </td>
      <td> <div class="actions"> <%= f.submit %> </div></td>
    </tr>

    <tr>  
    </tr>
  </table>
<% end %>
